package org.gp.core.entity;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 活动信息表
 * </p>
 *
 * @author LuoLiang
 * @since 2017-03-14
 */
@Data
public class Activity extends Model<Activity> {

    private static final long serialVersionUID = 1L;

	/**
	 * 
	 */
	@TableId(value = "id")
	private Integer id;

	/**
	 * 活动名称
	 */
	private String name;

	/**
	 * 开始时间
	 */
	private Date startdate;

	/**
	 * 活动介绍
	 */
	private String introduction;

	/**
	 * 活动地点
	 */
	private String place;

	/**
	 * 活动类型
	 */
	private String label;

	/**
	 * 预算每人单价
	 */
	private Double budget;

	/**
	 * 人数限制
	 */
	@TableField(value="person_num")
	private Integer personNum;

	/**
	 * 发起人ID
	 */
	@TableField(value="sponsor_userid")
	private Integer sponsorUserid;

	/**
	 * 
	 */
	private Integer ispass;

	private String desn;

	@Override
	protected Serializable pkVal() {
		return id;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;

		Activity activity = (Activity) o;

		if (!id.equals(activity.id)) return false;
		if (!name.equals(activity.name)) return false;
		if (!startdate.equals(activity.startdate)) return false;
		if (!introduction.equals(activity.introduction)) return false;
		if (!place.equals(activity.place)) return false;
		if (!label.equals(activity.label)) return false;
		if (!budget.equals(activity.budget)) return false;
		if (!personNum.equals(activity.personNum)) return false;
		if (!sponsorUserid.equals(activity.sponsorUserid)) return false;
		return ispass.equals(activity.ispass);
	}

	@Override
	public int hashCode() {
		int result = id.hashCode();
		result = 31 * result + name.hashCode();
		result = 31 * result + startdate.hashCode();
		result = 31 * result + introduction.hashCode();
		result = 31 * result + place.hashCode();
		result = 31 * result + label.hashCode();
		result = 31 * result + budget.hashCode();
		result = 31 * result + personNum.hashCode();
		result = 31 * result + sponsorUserid.hashCode();
		result = 31 * result + ispass.hashCode();
		return result;
	}
}
